<?php
namespace App\Api\Transformers;


use App\Match;
use League\Fractal\TransformerAbstract;

/**
 * Class MatchTransformer
 * @package App\Api\Transformers
 */
class MatchTransformer extends TransformerAbstract
{
    /**
     * @param Match $Match
     * @return array
     */
    public function transform(Match $match)
    {
        $avatarUrl = "http://yuejian.app/uploads/avatars/";
        return [
            'match_id' => $match['id'],
            'match_name' => $match['match_name'],
            'match_picture' => $avatarUrl.$match['match_picture'],
        ];
    }
}